<template>
	<view class="container">
		<image class="img" src="@/static/image/loading.png"></image>
	</view>
</template>

<script>
	import { mapActions,mapState } from 'vuex'
	export default {
		computed: {
			...mapState(['scene'])
		},
		methods: {
			...mapActions(['getUserOpenId','platformAuth','getUserStatus']),
		},
		onShow(e) {
			this.$store.commit('setIsRedirectUrl',false)
			const token = this.$cache.get('_token')
			console.log('token',token)
	
			// #ifndef MP-WEIXIN
				// 平台和浙里办进入自动注册
				this.platformAuth().then(this.getUserStatus)
			// #endif
	
			// #ifdef MP-WEIXIN
				if(token){
					console.log(8989)
					// if(this.scene != 1037){
						this.$store.commit('setToken',token)
						this.getUserOpenId().then(this.getUserStatus)	
					// }
				}else {
					this.getUserOpenId()
					.then(this.platformAuth)
					.then(this.getUserStatus)
				}
			// #endif
		},
	
		onHide() {
	
		}
	}
</script>

<style lang="scss" scoped>
	.container{
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		background-color: $uni-bg-color;
		
		.img{
			width: 464rpx;
			height: 304rpx;
		}
	}
</style>
